<?php

/*
 *制作公共翻页
 *@params start
 *@params total
 *return array
 */

function sss($start,$total,$per = 20)
{
    $res = array();
    $res['start'] = $start;
    $res['total'] = $total;
    $res['pages'] = ceil($total / ($per == 0) ? (int) 1 : $per);
    $res['limit'] = min(20,$res['total'] - $res['start']);
    return $res;
}
